//
//  timeTableView.h
//  ElektroM
//
//  Created by Michael on 12.10.09.
//  Copyright 2009 Artgruppe inc. All rights reserved.
//

#import <UIKit/UIKit.h>
//#import "timeTableAnother.h"
#include "structForDB.h"

@class AtomicElementViewController;
@class Train;
@class dataBase;

@interface timeTableView : UIViewController <UINavigationBarDelegate, UITableViewDelegate, 
	UITableViewDataSource>{	
	NSUInteger _nStationId;
	
	// view for showing opposing direction of the train:
	timeTableView* _frmBrother;

	timeTableInfo* _iTimeTables;
	// recreation of old time tables with apple structs:
	NSArray*	_aiStartStations;
	NSArray*	_aiEndStations;
	NSArray*	_aiTimes;
	NSArray*	_aiTrainIds;
	NSArray*	_aiiTrainInfo;
		
	bool _bReleaseMySelf;

	NSString* _sDataBaseName;
	bool _bUseFilter;	// if we shouldn't show time of leaved trains	
	dataBase* _db;
		
	NSUInteger _direction;
		
	// external:	
	NSString* strTitle;	// string for showing station name on the upper part of the screen		
		
	// experemental element for showing detailed info about train:
	AtomicElementViewController* detailedViewController;
	IBOutlet UIToolbar* toolbar;	
	IBOutlet UIBarButtonItem* timeFilter; // for updating the name of bottom toolbar
	IBOutlet UITableView *tableView;	// for updating table
	// stuff needed for hiding tabBar and showing instead our toolbar:
	UITabBarController* tabBarController;
}
@property (nonatomic, retain) UITabBarController* tabBarController;
@property (nonatomic, retain) AtomicElementViewController* detailedViewController;

// outlets:
@property (nonatomic, retain) IBOutlet UIToolbar* toolbar;
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic, retain) IBOutlet UIBarButtonItem* timeFilter;
// upper title:
@property (nonatomic, retain) NSString* strTitle;

@property NSUInteger _nStationId;
@property NSUInteger _direction;
@property (nonatomic, retain) timeTableView* _frmBrother;
@property (nonatomic, retain) NSString* _sDataBaseName;

-(void)updateData;
- (IBAction) showAnotherDirection;
- (IBAction) filterAddRemove;
-(void) releaseUnneededData;
@end
